async function loadCategoryData() {
    const container = document.querySelector("#category-container");
    if (!container) return;

    try {
        // 示例：从本地 JSON 文件加载或从后端获取
        const response = await fetch("data/categories.json");
        const data = await response.json();

        container.innerHTML = "";
        data.forEach(item => {
            const div = document.createElement("div");
            div.className = "category-item";
            div.innerHTML = `
                <h3>${item.name}</h3>
                <p>${item.description}</p>
            `;
            container.appendChild(div);
        });
    } catch (err) {
        console.error("加载分类数据失败：", err);
        container.textContent = "加载失败，请稍后重试。";
    }
}

document.addEventListener("DOMContentLoaded", loadCategoryData);